package com.avic.gateway.common.annotation;

import com.avic.gateway.common.annotation.impl.ZuulFilterRegister;
import com.netflix.zuul.DefaultFilterFactory;
import com.netflix.zuul.FilterFactory;
import com.netflix.zuul.ZuulFilter;
import org.springframework.context.annotation.Import;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 引入过滤器列表
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
@Documented
@Import(ZuulFilterRegister.class)
public @interface ImportFilters {
    /**
     * 过滤器类列表
     *
     * @return 过滤器列表
     */
    Class<? extends ZuulFilter>[] filters();

    /**
     * 过滤器工厂
     *
     * @return 过滤器工厂
     */
    Class<? extends FilterFactory> filterFactory() default DefaultFilterFactory.class;
}
